#include <algorithm>
#include <cstdint>
#include <iostream>
#include <istream>
using ll = int64_t;

ll n,nmax,ans;

int main(){
    std::iostream::sync_with_stdio(false);
    std::cin.tie(nullptr);

    std::cin>>n;
    for(ll i=1;i<=n;i++){
        ll tmp;
        std::cin>>tmp;
        nmax=std::max(nmax,tmp);
        if(nmax<=i){
            ans++;
        }
    }
    std::cout<<ans<<"\n";
}